package com.lzj.demo.design.visitor.visitor;

import com.lzj.demo.design.visitor.user.Student;
import com.lzj.demo.design.visitor.user.Teacher;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class President implements IVisitor{

    @Override
    public void visit(Student student) {
        log.info("学生信息-> 姓名:{}，班级:{}，班级人数:{}",student.name,student.clazz,student.count()+"人");
    }

    @Override
    public void visit(Teacher teacher) {
        log.info("教师信息-> 姓名:{}，年段:{}，升学率:{}",teacher.name,teacher.clazz,teacher.enterRatio()+"%");
    }
}
